import java.util.Deque;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;

/**
 * @ Author     ：侯耀祖
 * @ Description：
 */
public class huiwen2 {
    public boolean isPalindrome(int x) {
//        StringBuilder result = new StringBuilder();
//        result.append(x);
//        return result.toString().contentEquals(result.reverse());
        if (x<0) return false;
        if (x==0) return true;
        if (x % 10 == 0) return false;
        Queue<Integer> queue = new LinkedList<>();
        int a = 0, b = 0, c = x;
        while (x>0){
            a = x % 10;
            queue.offer(a);
            x /= 10;
        }
        while(!queue.isEmpty()){
            b = b*10 + queue.remove();
        }
        return b == c;
    }
}
